<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,minimal-ui:ios">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>格式化调试工具</title>
    <link rel="stylesheet" href="">
    <script src=""></script>
</head>
<style>
    .button {
        background-color: #08c3fb;
        /* Green */
        border: none;
        color: white;
        padding: 15px 32px;
        text-align: center;
        text-decoration: none;
        display: inline-block;
        font-size: 16px;
    }
</style>

<body>
    <h1>格式化调试工具</h1>

    <p>
        这个小工具在开发阶段用于生成符合JSON规范的字符串
    </p>
    <div>
        <h3>Lua源码</h3>
        <textarea id="data" name="data" rows="10" cols="100">
function Main(arg)
    return 0
end
</textarea>
    </div>
    <div>
        <h3>转换后的字符串</h3>
        <textarea id="data2" name="data2" rows="10" cols="100"></textarea>
    </div>
    <div>
        <button class="button" onclick="gettext()">转换</button>
    </div>
</body>
<script type="text/javascript">

    function gettext() {
        let s = document.getElementById("data").value.toString()
        document.getElementById("data2").innerHTML = JSON.stringify(s);
    }
</script>

</html>